<?php
require_once 'Zend/Db/Table/Abstract.php';
class AdminModel extends Zend_Db_Table_Abstract
{
	protected $_name = 'admin';
	protected $_id = 'id';
	public function admin(){
		$db = Zend_Registry::get('connectDB');
		$mySql = $db->select()
					->from('admin');
		$list = $db->fetchAll($mySql);
		return $list;
	}
   public function id_admin($id){
		$db = Zend_Registry::get('connectDB');
		$mySql = $db->select()
					->from('admin')
					->where("id =?",$id);
		$list = $db->fetchAll($mySql);
		return $list;
	}
	
	public function get_email_admin($email){
		$db = Zend_Registry::get('connectDB');
		$mySql = $db->select()
					->from('admin')
					->where("email =?",$email);
		$list = $db->fetchAll($mySql);
		return $list;
	}
	
	public function getAdminList(){
		$db = Zend_Registry::get('connectDB');
		$mySql = $db->select()
		->from('admin');
		$list = $db->fetchAll($mySql);
		return $list;
	}
	
	/*
	 * lấy ra user đầu tiên
	 */
	
	public function getUserFirts(){
		$db = Zend_Registry::get('connectDB');
		$mySql = $db->select()
					->from('admin')
					->limit(1,0);
		$list = $db->fetchAll($mySql);
		return $list;
	}
}